<template>
  <div class="leftItem cursor" @click="toDetail(childMsg.id)">
    <div class="leftImg">
      <img :src="childMsg.imgUrlIcon" alt="">
    </div>
    <div class="leftContent">
      <div>{{childMsg.name}}</div>
      <div>{{childMsg.gameSize}}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'introduceList',
  props: [ 'childMsg' ],
  data () {
    return {
      msg: ''
    }
  },
  methods: {
    toDetail (id) {
      this.$emit('toDetail', id)
      // this.$router.push({path: '/detail', query: { userId: id }})
      // this.$parent.toDetail(id)
    }
  },
  mounted: function () {
    this.$nextTick(function () {
      // Code that will run only after the
      // entire view has been rendered
    })
  }
}
</script>
<style scoped>
  .leftItem{
    display: flex;
    flex-direction: row;
    margin-right: 12px;
    padding:10px;
    text-align: left;
  }
  .leftItem:hover{
    background-color: rgba(245, 245, 245, 1);
  }
  .leftImg img{
    width: 60px;
    height: 60px;
    margin-right: 10px;
  }
  .leftContent{
     display: flex;
     flex-direction: column;
     justify-content: center;
   }
  .leftContent :first-child{
    margin-bottom: 10px;
  }
  .chosed {
    background-color: red;
  }
  .cursor{

  }
</style>
